stage.set_background("schoolentrance")
sprite = codesters.Sprite("cheerleader4")
t = codesters.Teacher()
try:
params = t.get_parameters_for_function('move_down')
tval1 = int(params[0][0])
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 50, "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you use the Move Down command?")
t1.add_failure(tval1 >= 300 or tval1 <= -300, "Did you move the sprite off of the stage?")
t1.add_creative(tval1 != 50 and tval1 <= 300 and tval1 >= -300 and tval1 != "DNE", "That is a good position for the sprite!")
#works if I comment out lines 12, 13, but not otherwise
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)